package com.hyx.spring.config;

import com.hyx.spring.bean.Cat;
import com.hyx.spring.bean.Fish;
import com.hyx.spring.dao.PersonDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @Author hyx
 * @Description TODO
 * @Date 2024/3/10 23:47
 * @Version 1.0
 */
@Configuration
@ComponentScan(value = {
        "com.hyx.spring.dao",
        "com.hyx.spring.service",
        "com.hyx.spring.controller",
        "com.hyx.spring.bean"})
public class AutowiredConfig {

    @Bean("personDao2")
    public PersonDao persondao(){
        return  new PersonDao("2");
    }

    @Bean
    public Fish fish(){

        return new Fish();
    }
}
